package com.ZeroCarbon.client;

import com.ZeroCarbon.config.FeignConfig;
import com.ZeroCarbon.utils.Result;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;


/**
 * 用户信息远程调用接口
 *
 * @since 2024-10-13
 */
@FeignClient(name = "user-server", configuration = FeignConfig.class)
public interface UserClient {

    /**
     * 获取用户基本信息
     *
     * @param userId 用户id
     */
    @GetMapping("/user/getBaseInfo")
    Result getBaseInfo(@RequestParam(value = "userId", required = false) String userId);

    /**
     * 获取用户名和头像
     *
     * @param id 用户id
     */
    @GetMapping("/user/getUsernameAndAvatar")
    Result getUsernameAndAvatar(@RequestParam("id") String id);

    /**
     * 更新账户余额和积分
     */
    @GetMapping("/user//addMoneyAndIntegral")
    Result addMoneyAndIntegral(@RequestParam String id, @RequestParam double money, @RequestParam int integral);
}
